package demo5;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

/**
 * Spring框架提供的注解:
 * @Component :被该注解标注的类，表示该类被Spring容器管理
 * @Controller :被该注解标注的类，表示该类被Spring容器管理，并且该类是控制层类
 * @Service :被该注解标注的类，表示该类被Spring容器管理，并且该类是业务逻辑层类
 * @Repository :被该注解标注的类，表示该类被Spring容器管理，并且该类是持久层类
 */
@Component
//@Controller
//@Service
//@Repository
public class Person {
//    @Autowired
//    @Resource
    @Resource(name="sweater")
//    private Clothes clothes;
    private Clothes shirt;
    public void play(){
//        clothes.wear();
        shirt.wear();
        System.out.println("出去玩");
    }
}
